{% extends "PlatBundle::layout.html.twig" %}


{% block title %}编辑个人信息{% endblock %}

{% block css %}{% endblock %}


{% block top %}
    {#{{ dump() }}#}
    {{ parent() }}
{% endblock %}



    {% block left_body_top %}
        {{ parent() }}
    {% endblock %}

    {% block left_body %}
        {{ parent() }}
    {% endblock %}

    {% block right_body %}
    <div class="page-header">
        <div class="page-right-top">
            <div class="right-top">
                <span class="right-title">系统设置</span>
            </div>
            <div class="top-nav">个人信息</div>
            <span class="r-arrow top-r-arrow"></span>
            <div class="top-nav top-nav-active">编辑修改</div>
        </div>
        <div class="main-content">
            <div class="mes-content">
                <form id="comMesBtn">
                    <div class="com-list">
                        <div class="com-list-box">
                            <div class="com-left fl">管理员姓名</div>
                            <input type="text" name="name" value="{{ data.realname|default("") }}" class="pop-com-input admin-name" style="width: 560px;" placeholder="请输入管理员姓名">
                        </div>

                        <div class="com-list-box">
                            <div class="com-left fl">手机号码</div>
                            <input type="text" name="phone" value="{{ data.phone|default("") }}" class="pop-com-input admin-name" style="width: 560px;" placeholder="请输入手机号码">
                        </div>

                        <div class="com-list-box">
                            <div class="com-left fl">邮箱</div>
                            <input type="text" name="email" value="{{ data.email|default("") }}" class="pop-com-input admin-email" style="width: 560px;" placeholder="请输入邮箱">
                        </div>

                        <div class="clearfix"></div>
                        <div class="add-mem-box" style="margin-top: 40px;">
                            <div class="com-left fl"></div>
                            <div class="acc-opera-btn fl mem-btn p-first-btn">保存</div>
                            <a class="acc-opera-btn fl mem-cancel" href="{{ path('plat_setting_index') }}">取消</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

    {% endblock %}


{% block box %}{% endblock %}


{% block javascript %}
<script type="text/javascript">
    $(function () {

        SidebarHighlighting('8');
        SonSidebar("8","1");


        $('.p-first-btn').on('click', function() {
            var param = $('#comMesBtn').serializeObject();

            console.log(param);

            if(param.name == ""){
                popStatus(2, "请输入姓名",1,"",true);
                return;
            }

            if(param.phone == ""){
                popStatus(2, "请输入手机号",1,"",true);
                return;
            }

            if(param.email == ""){
                popStatus(2, "请输入邮箱",1,"",true);
                return;
            }

            $.post("{{ path('api_platform_edit_self_message') }}",param,function(data){
                console.log(data);

                if(data.errorCode == 0){
                    popStatus(1, data.message,1,"{{ path('plat_setting_index') }}",true);
                } else {
                    popStatus(2, data.message,1,"",true);
                }


            })
        })
    })
</script>

{% endblock %}